🎖️GitЯра🎖️
Commit 4ea3f27e8c78a3b3bd906ea57b38e6359dbe0914
Parents : 9c4db49
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-07-06T10:13:24-05:00
Committer : GitHub <noreply@github.com>
Date : 2026-07-06T15:13:24Z
test: activate dead NodeInfoDao tests (#6113)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Changes
2 files changed, 32 insertions(+), 0 deletions(-)
Diff
diff --git a/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/NodeInfoDaoTest.kt b/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/NodeInfoDaoTest.kt
new file mode 100644
index 0000000000..e04eeb1e80
--- /dev/null
+++ b/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/NodeInfoDaoTest.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.core.database.dao
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import org.junit.runner.RunWith
+import org.robolectric.annotation.Config
+
+@RunWith(AndroidJUnit4::class)
+@Config(sdk = [34])
+class NodeInfoDaoTest : CommonNodeInfoDaoTest()
diff --git a/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonNodeInfoDaoTest.kt b/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonNodeInfoDaoTest.kt
index 942bce34f0..7c73212adc 100644
--- a/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonNodeInfoDaoTest.kt
+++ b/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonNodeInfoDaoTest.kt
@@ -23,6 +23,7 @@ import org.meshtastic.core.database.MeshtasticDatabase
import org.meshtastic.core.database.entity.MyNodeEntity
import org.meshtastic.core.database.entity.NodeEntity
import org.meshtastic.core.database.getInMemoryDatabaseBuilder
+import org.meshtastic.core.testing.setupTestContext
import org.meshtastic.proto.User
import kotlin.test.AfterTest
import kotlin.test.Test
@@ -49,6 +50,7 @@ abstract class CommonNodeInfoDaoTest {
)
suspend fun createDb() {
+ setupTestContext()
database = getInMemoryDatabaseBuilder().build()
dao = database.nodeInfoDao()
dao.setMyNodeInfo(myNodeInfo)
@@ -61,6 +63,7 @@ abstract class CommonNodeInfoDaoTest {
@Test
fun testGetMyNodeInfo() = runTest {
+ createDb()
val info = dao.getMyNodeInfo().first()
assertNotNull(info)
assertEquals(myNodeInfo.myNodeNum, info.myNodeNum)
@@ -68,6 +71,7 @@ abstract class CommonNodeInfoDaoTest {
@Test
fun testUpsertNode() = runTest {
+ createDb()
val node =
NodeEntity(
num = 1234,
@@ -82,6 +86,7 @@ abstract class CommonNodeInfoDaoTest {
@Test
fun testNodeDBbyNum() = runTest {
+ createDb()
val node1 = NodeEntity(num = 1, user = User(id = "!1"))
val node2 = NodeEntity(num = 2, user = User(id = "!2"))
dao.putAll(listOf(node1, node2))
@@ -94,6 +99,7 @@ abstract class CommonNodeInfoDaoTest {
@Test
fun testDeleteNode() = runTest {
+ createDb()
val node = NodeEntity(num = 1, user = User(id = "!1"))
dao.upsert(node)
dao.deleteNode(1)
@@ -103,6 +109,7 @@ abstract class CommonNodeInfoDaoTest {
@Test
fun testClearNodeInfo() = runTest {
+ createDb()
val node1 = NodeEntity(num = 1, user = User(id = "!1"), isFavorite = true)
val node2 = NodeEntity(num = 2, user = User(id = "!2"), isFavorite = false)
dao.putAll(listOf(node1, node2))
Served by rngit 1.5.2 - Generated in 0.04s